package com.rd.student.jike.class2.xuezhixin.day0801;

import java.util.Arrays;

public class TestXuanze {

    public static void main(String[] args) {
        int[] arr = {60,77,33,55,11,22,80};
        for (int i = 0;i<arr.length-1;i++){
            int minIndex = i;
            boolean b = true;
            for (int j = i;j<arr.length;j++){
                if (arr[j] < arr[minIndex]){
                    minIndex = j;
                    b = false;
                }
            }
            if(b) break;
            int a = arr[minIndex];
            arr[minIndex] = arr[i];
            arr[i] = a;
        }

        System.out.println(Arrays.toString(arr));
    }
}